package org.example;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Logger;

public class newThreadDemo {
    private static Logger logger = Logger.getLogger(newThreadDemo.class.getName());
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(5);
        for (int i = 0; i < 5; i++) {
            executorService.execute(new Runnable() {
                public void run() {
                    logger.info("hello thread"+Thread.currentThread().getName());
                }
            });
        }
        executorService.shutdown();
    }
}
